import { reqIndexData } from '../../api/index'

Page({
  // 初始化数据
  data: {
    bannerList: [],
    categoryList: [],
    activeList: [],
    hotList: [],
    guessList: [],
    loading: true // 是否显示骨架屏
  },

  async getIndexData() {
    // 调用接口获取数据
    const res = await reqIndexData()
    this.setData({
      bannerList: res[0].data,
      categoryList: res[1].data,
      activeList: res[2].data,
      guessList: res[3].data,
      hotList: res[4].data,
      loading: false
    })
  },

  // 监听页面加载
  onLoad() {
    this.getIndexData()
  },

  // 转发功能 好友群聊
  onShareAppMessage() {},

  // 分享到朋友圈
  onShareTimeline() {}
})
